Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

chore: show fullAppData if available #550

Merged
merged 1 commit into from
Jul 16, 2023
Merged

chore: show fullAppData if available #550

merged 1 commit into from
Jul 16, 2023

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jul 13, 2023

Summary

Companion PR for cowprotocol/cowswap#2838 of CoW Swap, and cowprotocol/cow-sdk#128 of the SDK

This PR shows the appData when the backend provides it.

image

Technical notes

It doesn't try to get it from IPFS, directly, if available it uses the one returned by the API

Not included

There's another way to derive the IPFS link now from the appData, however this doesn't work for now until the backend uploads the docs to IPFS.

Once they do we will need to come back and review the logic for generating the IPFS URL, now it will take you to a 404. Leaving this for another PR.

To Test

  1. Check how this order don't show the appData in production/barn/deveopment 0x60e2dd0aca15d6f1c604e35b96f406393aff563d01202eec8bd73db397352aec79063d9173c09887d536924e2f6eadbabac099f564ad372e
  2. How can this PR can show it https://explorer-dev-git-use-fullappdata-cowswap.vercel.app/orders/0x60e2dd0aca15d6f1c604e35b96f406393aff563d01202eec8bd73db397352aec79063d9173c09887d536924e2f6eadbabac099f564ad372e?tab=overview
  3. New orders created right now in https://dev.swap.cow.fi/ can only be presented in this PR

Background

This is part of the changes introduced after CoW Hooks

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
explorer-dev ✅ Ready (Inspect) Visit Preview Jul 13, 2023 4:28pm

@github-actions
Copy link

Pull Request Test Coverage Report for Build 5545557164

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 61.669%

Totals Coverage Status
Change from base Build 5544026700: 0.0%
Covered Lines: 876
Relevant Lines: 1235

💛 - Coveralls

const decodedAppData = JSON.parse(fullAppData)
return { decodedAppData, isError: false }
} catch (error) {
console.error('Error parsing fullAppData from the API', { fullAppData }, error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this branch also return isError: true ?

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the previous comment, working great!

@anxolin anxolin merged commit ad6ebfd into develop Jul 16, 2023
@alfetopito alfetopito deleted the use-fullAppData branch July 19, 2023 09:42
@nenadV91 nenadV91 mentioned this pull request Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants